package com.xjczjj.config.web;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CORSConfig implements WebMvcConfigurer {
    public void addCorsMappings(org.springframework.web.servlet.config.annotation.CorsRegistry registry)
    {
        registry.addMapping("/**")
                .allowedOrigins("*") //允许所有的请求域名访问我们的跨域资源
                .allowedMethods("*")
                .allowedHeaders("*");
    }
}
